Skip to content

Pin GitHub Actions to commit SHAs and let Dependabot update them#38

Open
tas50 wants to merge 1 commit into
chef:mainfrom
tas50:ci/pin-actions-dependabot
Open

Pin GitHub Actions to commit SHAs and let Dependabot update them#38
tas50 wants to merge 1 commit into
chef:mainfrom
tas50:ci/pin-actions-dependabot

Conversation

@tas50

@tas50 tas50 commented Jun 28, 2026

Copy link
Copy Markdown

Summary

Hardens and modernizes the GitHub Actions pinning, and sets up Dependabot to keep it current.

Pin actions to commit SHAs

Both workflows referenced actions by mutable major tags, which had also drifted out of sync — actions/checkout was @v6 in ci.yml but @v4 in lint.yml. A tag can be force-pushed to point at new code after a maintainer (or attacker) changes it, so a tag is not an immutable pin. Each action is now pinned to a full-length commit SHA at its current latest release, with a trailing version comment:

Action Version SHA
actions/checkout v7.0.0 9c091bb…
ruby/setup-ruby v1.314.0 9eb537c…
r7kamura/rubocop-problem-matchers-action v1.2.2 59f1a07…

Keep them updated with Dependabot

Added a github-actions ecosystem to .github/dependabot.yml. Dependabot understands SHA-pinned actions and will open PRs that bump both the SHA and the version comment as new releases ship, so pinning no longer means going stale.

Cooldown

Added a 7-day cooldown to both the existing bundler ecosystem and the new github-actions ecosystem, so Dependabot waits a week before proposing newly published versions — a guard against pulling in a freshly compromised or unstable release.

Notes

The workflows referenced actions by mutable major tags, which had also
drifted out of sync (checkout was @v6 in ci.yml and @v4 in lint.yml).
A tag can be repointed at malicious code after review, so pin every
action to a full-length commit SHA (the only immutable reference) at its
current latest release, with a version comment for readability:

- actions/checkout    -> v7.0.0
- ruby/setup-ruby      -> v1.314.0
- r7kamura/rubocop-problem-matchers-action -> v1.2.2

Add a github-actions ecosystem to Dependabot so these SHAs are bumped
automatically as new releases ship, and add a 7-day cooldown to both
ecosystems so freshly published versions are not adopted immediately.

Signed-off-by: Tim Smith <tsmith84@proton.me>
@tas50
tas50 requested review from a team and jaymzh as code owners June 28, 2026 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant